package com.iphone.extra.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;

public class AppScrollView extends ScrollView {

    private boolean isScrollEnable = true;

    public AppScrollView(Context context) {
        this(context, null, 0);
    }

    public AppScrollView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public AppScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public void setScrollEnable(boolean enable) {
        isScrollEnable = enable;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return isScrollEnable && super.onInterceptTouchEvent(ev);
    }
}
